//
//  YDAOptionalStockModel.m
//  siyanone
//
//  Created by LK-IOS on 2018/3/26.
//  Copyright © 2018年 LK-News. All rights reserved.
//

#import "YDAOptionalStockModel.h"

@implementation YDAOptionalStockModel

+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{
             @"Id" : @"id"
             };
}

-(NSString *)persentUpDown
{
    if (!self.upDropSpeed) {
        return @"--";
    }else{
        NSString *persentString = [self.upDropSpeed pz_stringNumberByMultiplyingBy:@"100"];
        return [NSString stringWithFormat:@"%@%@",persentString , @"%"];
    }
}

-(SYAOptionalStockModelPriceColor)priceColor
{
    if (!self.upDropSpeed) {
        return Price_Other;
    }else{
        if ([self.upDropSpeed floatValue] >= 0) {
            return Price_Up;
        }else{
            return Price_Down;
        }
    }
}


-(NSString *)nowPrice
{
    if (!self.lastPrice) {
        return @"--";
    }else{
        NSString *string = [NSString stringWithFormat:@"%@" , self.lastPrice];
        return [string pz_stringNumberByMultiplyingBy:@"1"];
    }
}


-(NSString *)belongString
{
    NSString *string = [NSString stringWithFormat:@"%@" , self.exponentCode];
    if ([string isEqualToString:@"4353"]) {
        return @"SH";
    }else if ([string isEqualToString:@"4609"]){
        return @"SZ";
    }else{
        return @"SZ";
    }
}

@end
